<?php
	DEFINE('H1', 'Reading RSS Feeds');
	DEFINE('TITLE','Reading RSS Feeds');
	require('includes/header.php');
?>	
<head>
	<style type="text/css">
		div.heading {
			font-weight: bolder;
		}
		div.story {
			background-color: white;
			border: 1px solid black;
			width: 320px;
			height: 200px;
			margin: 20px;
		}
		div.headline a {
			font-weight: bolder;
			color: orange;
			margin: 20px;
		}
		div.body {
			margin: 5px;
		}
		div.timestamp {
			font-size: smaller;
			font-style: italic;
			margin: 5px;
		}
		ul {
			list-style-type: none;
		}
		li { 	
			float: left;
		}
	</style>
</head>
<body>
	<h2><?PHP echo H1 ?></h2>
<?php
$xml = simplexml_load_file("http://www.newsvine.com/_feeds/rss2/tag?id=technology") 
	 	or die("ERROR: Cannot read RSS feed");
?>
<h3 style="heading"><?php echo $xml->channel->title; ?></h3>
<ul>
<?php
	foreach ($xml->channel->item as $item) {
?>
<li>
	<div class="story">
		<div class="headline">
			<a href="<?php echo $item->link; ?>">
				<?php echo $item->title; ?>
			</a>
		</div>
		<div class="timestamp"><?php echo $item->pubDate; ?></div>
		<div class="body"><?php echo $item->description; ?></div>
	</div>
</li>
<?php } ?>
</ul>

<?php
	require('includes/footer.php');
?>